Skip to content

feat: support native plans in output modes - #71

Closed
jefft72 wants to merge 2 commits into
stack/native-plan-08-routing-api-testsfrom
stack/native-plan-09-output-modes
Closed

jefft72 wants to merge 2 commits into
stack/native-plan-08-routing-api-testsfrom
stack/native-plan-09-output-modes

Conversation

@jefft72

@jefft72 jefft72 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds first-class plan rendering to exported HTML while keeping native plan lifecycle state outside print, JSON, and RPC execution protocols.
Non-interactive modes now reject plan-aware startup, prompt, navigation, fork, clone, new-session, switch-session, and rebind targets before those operations can mutate the active session.

Reasoning

Submitted plans are durable user-facing artifacts and should remain readable, searchable, and copyable in a human session export.
Collaboration-mode changes and resolution records are internal bookkeeping, so the default export view can hide them without hiding the plan that a reviewer actually needs to inspect.

Machine-oriented hosts do not yet implement plan decisions or accepted-plan profile selection.
Suppressing lifecycle events alone would leave an unsafe half-supported state, so print, JSON, and RPC must also fail before entering or adopting plan state and must repeat that check around every asynchronous prompt and replacement boundary.

Changes

  • Indexes plan titles and Markdown for HTML search, renders the title in the session tree, and displays the submitted Markdown through the existing sanitized renderer in the transcript.
  • Classifies collaboration-mode and plan-resolution records as settings entries so default and no-tools export filters hide bookkeeping while the all-entries view can still identify mode and resolution transitions.
  • Narrows the JSON event type to exclude collaboration-mode, plan-submitted, and plan-resolved events, and makes event conversion return no wire value for those internal lifecycle notifications.
  • Updates JSON print and RPC subscribers to skip filtered lifecycle events without emitting undefined, while preserving all supported agent and profile-switch events.
  • Guards print and JSON mode at startup, on session rebind, before and after each queued prompt, and after any prompt that might have entered plan state so later queued messages cannot run across an unsupported transition.
  • Passes plan-aware target validators through extension-driven new-session, switch-session, fork, and tree-navigation actions, validating the selected leaf before the current tree or bound session changes.
  • Guards RPC before taking over standard I/O, before every prompt, after session rebind, and across direct new-session, switch-session, fork, clone, and extension command paths.
  • Returns normal RPC command failures for rejected plan targets while keeping the current session and leaf intact, including malformed lifecycle targets and accepted continuations restored from another branch.
  • Adds focused HTML, print, JSON, and RPC tests for artifact rendering, hidden bookkeeping, startup rejection, target validation, queued-prompt transitions, protocol type exclusion, and streaming steer or follow-up delivery.

Testing

  • Validation ran on the final rebased stack: npm run check passed.
  • Validation ran on the final rebased stack: the focused Vitest run across 28 affected files passed all 451 tests.
  • This intermediate branch was reconstructed as part of the stack and was not checked independently after reconstruction.

@jefft72 jefft72 added enhancement New feature or request coding-agent labels Aug 16, 2026
@jefft72
jefft72 requested review from Issacboy123 and Pepps233 and removed request for Issacboy123 August 16, 2026 00:11
@Issacboy123
Issacboy123 force-pushed the stack/native-plan-09-output-modes branch from f3060e1 to 5e46a76 Compare August 16, 2026 03:14
Render native plan artifacts in exported HTML and reject plan lifecycle state from print-mode activation paths. Cover tree export, queued prompts, and JSON event suppression without exposing plan bookkeeping.
Keep native plan lifecycle state out of JSON and RPC wire protocols while rejecting non-interactive plan targets before mutation. Cover startup, replacement, prompt, and streaming command boundaries.
@Pepps233
Pepps233 force-pushed the stack/native-plan-09-output-modes branch from 5e46a76 to bdf9653 Compare August 16, 2026 04:15
@jefft72

jefft72 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing to rebuild on a clean base.

This stack does not build. Two separate defects are present, and the first masks the second:

  1. A stray closing brace committed in feat: enforce native plan collaboration policy #64 stops packages/coding-agent/src/core/agent-session.ts from parsing at all.
  2. From feat: activate accepted plans in routed sessions #65 onward the stack imports five modules that exist only on the task profile stack: evolved.ts, harness-descriptors.ts, profile-router.ts, profiles.ts, and runtime-telemetry.ts.

Replacement stacks:

  • plan/* for native plan mode standing alone on main
  • plan-harness/* for the plan and profile integration

The branch behind this PR is retained unchanged as a backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant